package com.luoc.spring;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author luoc
 * @version 1.0
 * @date 2021/1/11 15:44
 * @since 1.0
 */
public class MyClassPathXmlApplicationContext extends ClassPathXmlApplicationContext {

      public MyClassPathXmlApplicationContext(String... configLocations){
          super(configLocations);
      }

      @Override
      protected void initPropertySources(){
         // getEnvironment().setRequiredProperties("VAR");
      }

      @Override
      protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory){
            super.setAllowBeanDefinitionOverriding(false);
            super.setAllowCircularReferences(false);
            super.customizeBeanFactory(beanFactory);
      }



}
